package com.tony.thread;

public class ShareThreadData extends Thread {
    public ShareThreadData(String name){
        this.setName(name);
    }

    public ShareThreadData(){

    }
    private int a = 3;
    @Override
    public void run() {
        while(a>0){
            a--;
            System.out.println(Thread.currentThread().getName()+"计算结果："+a);
        }
    }

    public static void main(String[] args) {
        ShareThreadData nstd = new ShareThreadData();
        new Thread(nstd).start();
        new Thread(nstd).start();
        new Thread(nstd).start();
    }
}
